package Chapter6.dao;

import org.hibernate.HibernateException;

import Chapter6.one_to_many.Book;
import Chapter6.one_to_many.Publisher;
import learnning.dao.base.HibernateDao;

public class PublisherDao extends HibernateDao {
	public void add(Publisher publisher, Book book) {
		try {
			begin();
			getSession().save(publisher);
			getSession().save(book);
			commit();
		} catch (HibernateException e) {
			rollback();
			e.printStackTrace();
		}
	}
}
